-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use find_packages
in cmake files to for shared lib build
#1084
base: main
Are you sure you want to change the base?
Conversation
oh thanks, let me revert the changes in |
find_packages
in cmake files to for shared lib build
This would be a problem if we install sqlite3 from (say) # dpkg-query -L libsqlite3-dev:amd64
/.
/usr
/usr/include
/usr/include/sqlite3.h
/usr/include/sqlite3ext.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libsqlite3.a
/usr/lib/x86_64-linux-gnu/libsqlite3.la
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/sqlite3.pc
/usr/share
/usr/share/doc
/usr/share/doc/libsqlite3-dev
/usr/share/doc/libsqlite3-dev/copyright
/usr/lib/x86_64-linux-gnu/libsqlite3.so
/usr/share/doc/libsqlite3-dev/changelog.Debian.gz
# dpkg-query -L libsqlite3-0:amd64
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
/usr/share
/usr/share/doc
/usr/share/doc/libsqlite3-0
/usr/share/doc/libsqlite3-0/README.Debian
/usr/share/doc/libsqlite3-0/changelog.Debian.gz
/usr/share/doc/libsqlite3-0/copyright
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0
# dpkg-query -L sqlite3
/.
/usr
/usr/bin
/usr/bin/sqldiff
/usr/bin/sqlite3
/usr/share
/usr/share/doc
/usr/share/doc/sqlite3
/usr/share/doc/sqlite3/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/sqldiff.1.gz
/usr/share/man/man1/sqlite3.1.gz
/usr/share/doc/sqlite3/changelog.Debian.gz |
@yulin-li - let us know if the PR is still valid ? |
sorry for this very late reply. The camke configurations is actually provided by cmake (https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake), not sqlite3 package. The problem without |
@ThomsonTan I saw you were updating this PR. Could it be reviewed and merge? So we can avoid patching it in our project. |
@yulin-li, is this PR still valid? Does the consuming of local install sqlite3 break other users who may not epect the local install? |
This is still valid. The local sqlite is only required if the user wants to build a shared lib. This won't change the behavior for static lib build. |
@@ -276,7 +276,9 @@ if(BUILD_SHARED_LIBS STREQUAL "ON") | |||
# Prefer shared libraries for sqlite3 and zlib | |||
add_library(sqlite3 SHARED IMPORTED GLOBAL) | |||
add_library(z SHARED IMPORTED GLOBAL) | |||
target_link_libraries(mat PUBLIC sqlite3 PUBLIC z ${LIBS} "${CMAKE_THREAD_LIBS_INIT}" "${CMAKE_DL_LIBS}" "${CMAKE_REQUIRED_LIBRARIES}") | |||
find_package(SQLite3 REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the current hard-coded name still works. But I think the find_package
is a preferred way by cmake, and it will report a clearer error if sqlite3
is not installed
No description provided.